const { BaseCommand } = require("./base");

class MysqlQueryCommand extends BaseCommand {
    async execute() {
        const connection = this.selfData.connection;
        return await new Promise((resolve, reject) => {
            connection.query(this.selfData.query, (error, results, _fields) => {
                if (error) reject(error);
                resolve(results);
            });
        });
    }
}

module.exports = {
    MysqlQueryCommand,
};
